#ifndef __XMLDBPARSER_H
#define __XMLDBPARSER_H

struct SessionLoggedStatus
{
    enum Enum
    {
        NotLogged = 0,
        Logged,
        Expired,
        BadLogin,
        UnknownStatus,
    };
};

struct ParseResult
{
    SessionLoggedStatus::Enum sessionStatus;
    QByteArray sessionId;
    QString queryErrorString;
    QByteArray queryResult;

    ParseResult()
    {
        reset();
    }
    void reset()
    {
        sessionStatus = SessionLoggedStatus::UnknownStatus;
        sessionId.clear();
        queryErrorString.clear();
    }
};

class XmlDbParser
{
public:
    XmlDbParser();
    ~XmlDbParser();
    bool parse( const QString & sourceData );
    const ParseResult & parseResult() const;

private:
    QString m_sourceData;
    ParseResult m_parseResult;
};

#endif
